public class Car {
    private String brand;
    private String color;
    private String motor;
    private int age;

    public Car(String brand, String color, String motor, int age) {
        this.brand = brand;
        this.color = color;
        this.motor = motor;
        this.age = age;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getMotor() {
        return motor;
    }

    public void setMotor(String motor) {
        this.motor = motor;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public boolean equals(Object object){
        if(this==object){
            return true;
        }if(!(object instanceof Car)){
            return false;
        }
        Car car=(Car) object;
        return this.brand.equals(car.brand)&&this.color.equals(car.color)&&this.motor.equals(car.motor)&&this.age==car.age;
    }
}
